//
//  HLSessionConfig.m
//  YueYue
//
//  Created by hulu001 on 2023/6/12.
//

#import "HLSessionConfig.h"
#import "HLSessionDataProovider.h"

@interface HLSessionConfig ()

@property (nonatomic, strong) NIMSession *session;
@property (nonatomic, strong) id<HLIMKitSessionDataProvider> provider;

@end

@implementation HLSessionConfig


- (instancetype)initWithSession:(NIMSession *)session
{
    self = [super init];
    
    if (self) {
        _session = session;
        _provider = [[HLSessionDataProovider alloc] init];
    }
    
    return self;
}

/// 开启聊天记录时间间隔显示
- (BOOL)shouldShowTime
{
    return YES;
}

- (id<HLIMKitSessionDataProvider>)messageDataProvider
{
    return self.provider;
}

/// 聊天会话内，未滑动到最底部，有新消息来时，开启新消息提醒
- (BOOL)canTipBottomNewMessages
{
    return YES;
}

- (BOOL)autoFetchHistoryWhenOpenSession
{
    return YES;
}

- (BOOL)shouldHandleReceiptForMessage:(NIMMessage *)message
{
    return YES;
}

- (NSArray<HLIMKitInputMoreItem *> *)moreItems
{
    NSArray *array = nil;
    
    HLIMKitInputMoreItem *cameraItem = [HLIMKitInputMoreItem itemWithTitle:@"拍摄" normalImage:[UIImage imageNamed:@"im_camera"] selectedImage:[UIImage imageNamed:@"im_camera"] selector:@"onTapCamera"];
    
    array = @[cameraItem];
    
    return array;
}

- (CGSize)moreItemSize
{
    return CGSizeMake(60, 83);
}

- (UIEdgeInsets)moreContainerContentInsets
{
    return UIEdgeInsetsMake(22, 30, 10, 30);
}

- (NSInteger)maxInputCharCount
{
    return 1500; // 限制最大输入字符数
}

- (CGFloat)heightForCustomHeaderView
{
    return 133;
}


@end
